import request from '../../../utils/request.js'

export function deleteContent(data) {
    return request({
        url: '/content/deleteContent',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/json',
        },
    });
}

export function getContentAll(params) {
    return request({
            url: '/content/getContentAll',
            method: 'get',
            params: {
                pageNum: params.pageNum,
                pageSize: params.pageSize,
                title: params.title || undefined
            }})
    }

    export function getContentCategoryAll() {
        return request({
            url: '/contentcategory/getTbContentAll',
            method: 'get'
        })
    }

    export function addContent(data) {
        return request({
            url: '/content/addContent',
            method: 'post',
            data,
            headers: {
                'Content-Type': 'multipart/form-data'
            }
        })
    }

    export function updateContent(data) {
        return request({
            url: '/content/updateContent',
            method: 'post',
            data,
            headers: {
                'Content-Type': 'multipart/form-data'
            }
        })
    }